Popular Searches
Popular Course Categories
Popular Courses

Discrete and Continuous Fields

Discrete and Continuous Fields

Dimensions, Measures, and Data Types

Discrete and Continuous Fields in Tableau

Course: Tableau Data Visualization and Business Intelligence

Topic: Discrete Fields, Continuous Fields, Blue and Green Pills, Axes, Headers, Date Fields, and Practical Visualization

Course Link: JustAcademy Tableau Training

Demo Link: Register for a Tableau Course Demo


1. Introduction

Tableau is a data visualization and business intelligence tool used to analyze data and create interactive charts, dashboards, and reports. While building a visualization, Tableau represents fields as either discrete or continuous. This distinction determines how field values appear in a worksheet.

A discrete field represents individually separate values, such as product categories, regions, or years displayed as separate labels. A continuous field represents a range of values, such as sales amounts or dates arranged along a timeline.

Tableau uses two important visual indicators:

  • Blue pills: Discrete fields, which typically create headers.
  • Green pills: Continuous fields, which typically create axes.

Understanding these field types helps you select the correct chart structure, organize information, and communicate trends effectively.


2. What Are Discrete Fields?

A discrete field contains individually separate and distinct values. Tableau treats these values as separate categories or members rather than as points along a continuous range.

For example, the values North, South, East, and West represent four distinct regions. Tableau can display each region as a separate header in a worksheet.

Examples of Discrete Fields

Field Example Values Use
Region North, South, East, West Compare performance by region
Category Furniture, Technology, Office Supplies Group products by category
Product Name Laptop, Chair, Printer Compare individual products
Customer Name Amit, Priya, Rahul Analyze customer records
Order Year 2024, 2025, 2026 Display each year as a separate header
Customer ID 101, 102, 103 Identify individual customers
Rating 1, 2, 3, 4, 5 Compare rating categories

Characteristics of Discrete Fields

  • Discrete pills are represented in blue in the worksheet.
  • They typically create row or column headers when placed on Rows or Columns.
  • They separate data into distinct categories or members.
  • They can be used to group, filter, label, and segment data.
  • They are useful for comparing categories and examining specific groups.
  • They can contain text, dates, Boolean values, and numeric values, depending on the field and its role.

Example

Suppose a company sells products in three categories. The Category field contains the following values:

Furniture
Technology
Office Supplies

If you drag Category to the Columns shelf, Tableau typically creates a separate column header for each category. When Sales is added to Rows, the view can compare sales for the three categories.


3. What Are Continuous Fields?

A continuous field represents values along an uninterrupted range. In Tableau, continuous fields generally create an axis when placed on Rows or Columns.

For example, sales values can range from ₹1,000 to ₹100,000. A continuous sales axis allows Tableau to position values according to their numerical magnitude.

Examples of Continuous Fields

Field Example Values Use
Sales 1000, 2500, 4200.50 Compare numerical sales values
Profit -500, 200, 1500 Analyze profit and loss
Quantity 1, 2, 3, 4 Analyze numerical quantities when an axis is useful
Temperature 20.5, 25.0, 31.2 Analyze a range of temperatures
Order Date Dates across several months Display a continuous timeline
Profit Margin 0.10, 0.25, 0.35 Compare ratios or percentages

Characteristics of Continuous Fields

  • Continuous pills are represented in green in the worksheet.
  • They typically create an axis when placed on Rows or Columns.
  • They represent values along a range rather than separate headers.
  • They are useful for displaying trends, distributions, and numerical relationships.
  • Continuous measures are usually aggregated when added to a view.
  • Numeric fields and date fields may be continuous, depending on their configuration and role.

Example

Suppose a company has monthly sales values of ₹10,000, ₹15,000, ₹12,000, and ₹20,000. If Sales is used as a continuous measure, Tableau can display a numerical axis to represent the size of each value.

Sales:
10000
15000
12000
20000

A continuous Sales axis is useful for comparing magnitudes and examining how values change when combined with a date field.


4. Difference Between Discrete and Continuous Fields

Basis Discrete Fields Continuous Fields
Meaning Values are individually separate Values are represented along a range
Pill color Blue Green
Display on Rows or Columns Typically creates headers Typically creates an axis
Typical purpose Grouping and category comparisons Showing magnitude, ranges, or trends
Example Category, Region, discrete Year Sales, continuous Date
Chart applications Category-based bar charts and cross-tabs Trend lines, numerical axes, and continuous scales
Color behavior Usually assigns colors to separate members Can show a continuous color gradient
Filter behavior Often lets you select individual members Can filter a numerical or date range

Important: Discrete and continuous describe how a field is represented in the view. They are not the same as dimensions and measures. Dimensions are often discrete and measures are often continuous, but Tableau supports other combinations.


5. Understanding Blue and Green Pills

A pill is the field representation that appears when you place a field on a Tableau shelf or card. The pill's color indicates whether the field is discrete or continuous in that view.

5.1 Blue Pills

A blue pill indicates that the field is discrete. When a blue field is placed on Rows or Columns, Tableau typically displays individual headers for the field's values.

Example:

Columns: Category (Blue)
Rows: SUM(Sales) (Green)

This setup commonly produces a chart comparing sales across individual product categories.

5.2 Green Pills

A green pill indicates that the field is continuous. When a green field is placed on Rows or Columns, Tableau typically creates an axis for the field.

Example:

Columns: MONTH(Order Date) (Green)
Rows: SUM(Sales) (Green)

When Order Date is configured as a continuous date, this arrangement can create a timeline-based sales trend.

Quick Memory Trick

  • Blue = Separate values = Headers.
  • Green = Continuous range = Axis.

6. Relationship Between Dimensions, Measures, Discrete, and Continuous

Dimensions and measures describe the role of a field in analysis. Discrete and continuous describe how the field is displayed in a visualization. These are two separate concepts.

Combination Example Explanation
Discrete Dimension Category Displays separate category headers
Continuous Dimension Continuous Order Date Displays a continuous date axis
Discrete Measure SUM(Sales) converted to discrete Shows aggregated sales values as headers or distinct values
Continuous Measure SUM(Sales) Shows sales on a continuous numerical axis

Example: Sales by Category

In a sales visualization:

  • Category is commonly a discrete dimension.
  • SUM(Sales) is commonly a continuous measure.
  • Category creates the headers used to separate groups.
  • SUM(Sales) provides the numerical values for comparison.

Changing SUM(Sales) from continuous to discrete changes how it is displayed. It does not automatically change the field from a measure into a dimension.


7. How to Convert a Field Between Discrete and Continuous

Tableau allows you to change the display behavior of supported fields. This is especially useful for numerical measures, numeric dimensions, and date fields.

Method 1: Change a Field in the Worksheet

  1. Open a Tableau worksheet.
  2. Place a supported field on Rows or Columns.
  3. Click the drop-down menu on the field pill.
  4. Select Discrete or Continuous, depending on the available options.
  5. Observe the pill color and the way the view changes.

Method 2: Change the Default in the Data Pane

  1. Locate the field in the Data pane.
  2. Right-click the field.
  3. Choose Convert to Discrete or Convert to Continuous when the option is available.
  4. Drag the field into the view to see its default behavior.

Example: Convert Sales to Discrete

  1. Drag Sales into the worksheet.
  2. Open the drop-down menu on the Sales pill.
  3. Select Discrete.
  4. Observe that the pill becomes blue and the field can display distinct aggregated values as headers.

Sales remains a measure unless you separately change its role. Tableau may still aggregate it, for example as SUM(Sales).

Example: Convert Sales Back to Continuous

  1. Open the drop-down menu on the discrete Sales pill.
  2. Select Continuous.
  3. Observe that the pill becomes green.
  4. Check that the view uses an axis for the continuous field.

Note: Available conversion options depend on the field's data type and role.


8. Discrete and Continuous Date Fields

Date fields are especially important because Tableau can display dates as discrete date parts or continuous date values. The choice affects how dates appear and how time-based analysis is presented.

8.1 Discrete Dates

A discrete date displays separate date categories or date parts, such as individual years, quarters, or month names.

Example:

YEAR(Order Date)
2024
2025
2026

If Year is discrete, Tableau can create separate headers for 2024, 2025, and 2026. This is useful when comparing yearly totals.

8.2 Continuous Dates

A continuous date represents time along a continuous axis. This is useful for showing how values change across a timeline.

Example:

MONTH(Order Date)
Jan 2026 ---- Feb 2026 ---- Mar 2026 ---- Apr 2026

When configured as a continuous date, Tableau can display a timeline axis suitable for a line chart.

Comparison of Date Types

Feature Discrete Date Continuous Date
Typical pill color Blue Green
View display Separate headers or date categories Continuous timeline axis
Example Yearly sales comparison Monthly sales trend over time
Best suited for Comparing distinct date parts Analyzing changes over time

How to Change a Date Field

  1. Drag Order Date to Columns.
  2. Open the field's drop-down menu.
  3. Choose the appropriate date level, such as Year, Quarter, Month, or Exact Date.
  4. Select a discrete or continuous date option when available.
  5. Add Sales to Rows to compare the results.
  6. Use a line chart when a time trend is the objective.

Important: A discrete month may represent the month name without preserving the year in the same way as a continuous month-and-year timeline. For multi-year data, check the selected date level so that different years are not unintentionally combined.


9. Practical Example: Sales by Category

Consider the following sample dataset:

Category Sales
Furniture 15000
Technology 25000
Office Supplies 12000

Steps to Create the Visualization

  1. Connect Tableau to the dataset.
  2. Open a new worksheet.
  3. Drag Category to Columns.
  4. Drag Sales to Rows.
  5. Ensure Category is discrete and SUM(Sales) is continuous.
  6. Select a bar chart if Tableau has not already selected one.
  7. Show labels if needed and sort the bars by sales.

Expected Result

Tableau displays separate category headers and a numerical sales axis. The bars allow you to compare total sales across Furniture, Technology, and Office Supplies.

Why this works: Category separates the data into groups, while Sales provides the numerical values for comparison.


10. Practical Example: Monthly Sales Trend

Assume a business wants to examine its sales performance over several months.

Month Sales
January 10000
February 14000
March 12000
April 18000
May 22000

Steps

  1. Drag Order Date to Columns.
  2. Choose Month and set it to continuous if you want a continuous timeline.
  3. Drag Sales to Rows.
  4. Confirm the appropriate aggregation, such as SUM(Sales).
  5. Choose a line chart.
  6. Format the date axis and add labels or tooltips if required.

Expected result: A line chart shows the changes in sales across the months, making increases and decreases easier to identify.

Business question: Are sales increasing, decreasing, or fluctuating over time?


11. How Discrete and Continuous Fields Affect Color

Discrete and continuous fields can also affect how Tableau applies colors when a field is placed on Color in the Marks card.

Discrete Color

A discrete field typically assigns separate colors to individual members. For example, using Category on Color can give Furniture, Technology, and Office Supplies different colors.

Continuous Color

A continuous field typically uses a color gradient to represent a range of values. For example, using SUM(Sales) on Color can display lower and higher sales values with different shades.

Field Type Typical Color Behavior Example
Discrete Separate colors for categories Color by Region
Continuous Gradient across a range Color by Sales Amount

Use categorical colors when the goal is to distinguish groups. Use a continuous gradient when the goal is to communicate the relative magnitude of values.


12. How Discrete and Continuous Fields Affect Filters

The field type can affect how Tableau presents filter options.

Discrete Field Filters

When a discrete dimension is added to Filters, Tableau commonly allows you to choose specific members, such as selected regions, categories, or years.

Example: Select only the West and South regions to focus the analysis on those locations.

Continuous Field Filters

When a continuous measure is added to Filters, Tableau generally asks you to select an aggregation and filter based on a numerical range or condition.

Example: Display records or marks where aggregated sales fall within a specified range, depending on the filter configuration.

Date Filters

Date fields can support different filtering behaviors depending on whether the filter is based on discrete date parts, a range of dates, or a relative date selection.

Best practice: Choose a filter type that matches the question. Use member selection to include specific categories and range filters to analyze values over a continuous interval.


13. Common Mistakes to Avoid

  • Assuming every number is continuous: A number can represent a distinct category, rating, code, or identifier.
  • Confusing field color with field role: Blue and green indicate discrete and continuous behavior, not simply dimension and measure.
  • Assuming a blue measure becomes a dimension: Changing a measure to discrete does not automatically change its role.
  • Choosing the wrong date type: A discrete month and a continuous timeline can communicate different kinds of information.
  • Using a continuous field for a category comparison without checking the result: If separate headers are required, a discrete field may be more suitable.
  • Using a discrete field for a time trend without considering date levels: This can create separate panes or headers rather than a single continuous timeline.
  • Ignoring aggregation: A continuous measure is commonly aggregated. Verify whether SUM, AVG, or another aggregation matches the analysis.
  • Using too many categories: A chart with many discrete headers can become crowded and difficult to read.
  • Misinterpreting color gradients: Continuous color represents a range, while discrete color usually distinguishes individual members.

14. Best Practices

  • Choose discrete fields when the purpose is to compare distinct categories or members.
  • Choose continuous fields when the purpose is to show numerical ranges, scales, or trends.
  • Remember the key rule: blue fields create headers; green fields create axes.
  • Verify whether a field is a dimension or measure separately from whether it is discrete or continuous.
  • Use continuous dates for suitable time-series analyses.
  • Use discrete dates when comparing separate years, quarters, or other date categories.
  • Check date levels when working with data covering multiple years.
  • Review aggregations before interpreting numerical results.
  • Use discrete colors to distinguish categories and continuous color gradients to represent magnitude.
  • Test different field configurations to determine which one best communicates the business insight.

15. Interview Questions and Answers

Q1. What is a discrete field in Tableau?

Answer: A discrete field contains individually separate values. It is typically represented by a blue pill and creates headers when placed on Rows or Columns.

Q2. What is a continuous field in Tableau?

Answer: A continuous field represents a range of values. It is typically represented by a green pill and creates an axis when placed on Rows or Columns.

Q3. What is the difference between blue and green pills?

Answer: Blue pills indicate discrete fields, while green pills indicate continuous fields.

Q4. Do discrete fields create axes?

Answer: Discrete fields generally create headers rather than continuous axes when placed on Rows or Columns.

Q5. Do continuous fields create headers?

Answer: Continuous fields generally create axes when placed on Rows or Columns.

Q6. Can a measure be discrete?

Answer: Yes. A measure can be changed to discrete. It remains a measure and may still be aggregated.

Q7. Can a dimension be continuous?

Answer: Yes. Numeric dimensions and date dimensions can be continuous when supported by their data type and configuration. String and Boolean dimensions cannot be continuous.

Q8. What is the difference between dimensions and discrete fields?

Answer: Dimensions describe the role of a field in analysis, while discrete describes how values are represented in the view. Dimensions are often discrete, but the terms are not interchangeable.

Q9. When should you use a continuous date?

Answer: Use a continuous date when you want to display a timeline and analyze how a measure changes over time.

Q10. When should you use a discrete date?

Answer: Use a discrete date when you want separate headers for years, quarters, months, or other date parts.

Q11. How do you convert a continuous field to discrete?

Answer: Open the field's drop-down menu in the view and choose Discrete, or right-click the field in the Data pane and select Convert to Discrete when available.

Q12. Does changing a measure from continuous to discrete change its aggregation?

Answer: Not necessarily. The change controls how the field is represented in the view. The measure can remain aggregated, such as SUM(Sales).

Q13. How does a discrete field affect color?

Answer: A discrete field placed on Color typically assigns separate colors to its individual members.

Q14. How does a continuous field affect color?

Answer: A continuous field placed on Color typically uses a gradient to represent a range of values.

Q15. What is a practical example of a discrete and continuous field used together?

Answer: Category can be used as a discrete field to create separate headers, while SUM(Sales) can be used as a continuous field to create a numerical axis for comparing sales across categories.


16. Practical Exercises

Exercise 1: Identify the Field Type

Determine whether each field would commonly be used as discrete or continuous for the stated purpose.

Field Purpose Suggested Choice
Region Compare regional sales Discrete
Sales Show a numerical sales axis Continuous
Category Compare product groups Discrete
Order Date Show a timeline Continuous
Order Year Compare separate yearly totals Discrete
Profit Show profit values on an axis Continuous

Exercise 2: Create a Bar Chart

  1. Connect Tableau to a sales dataset.
  2. Drag Category to Columns.
  3. Drag Sales to Rows.
  4. Confirm Category is discrete and Sales is continuous.
  5. Display a bar chart.
  6. Sort categories by sales.
  7. Write down the category with the highest sales.

Exercise 3: Compare Discrete and Continuous Dates

  1. Drag Order Date to Columns.
  2. Choose Year as a discrete date.
  3. Drag Sales to Rows and observe the separate year headers.
  4. Change the date field to a continuous date at an appropriate level.
  5. Observe the timeline axis and compare the results.
  6. Explain which view is better for comparing yearly totals and which is better for examining a time trend.

Exercise 4: Convert a Measure

  1. Drag Sales to Columns.
  2. Observe the green pill and continuous axis.
  3. Change Sales to Discrete when the option is available.
  4. Observe the blue pill and header-based display.
  5. Change Sales back to Continuous.
  6. Explain how the view changes and whether the field's aggregation has changed.

17. Quick Revision Notes

  • Discrete: Individually separate values.
  • Continuous: Values represented along an uninterrupted range.
  • Blue pill: Discrete field.
  • Green pill: Continuous field.
  • Discrete on Rows or Columns: Typically creates headers.
  • Continuous on Rows or Columns: Typically creates an axis.
  • Discrete date: Useful for separate date categories or date parts.
  • Continuous date: Useful for a timeline and trend analysis.
  • Discrete color: Typically assigns different colors to members.
  • Continuous color: Typically displays a gradient.
  • Field role: Dimension or measure.
  • Field display behavior: Discrete or continuous.
  • Remember: Changing a measure to discrete does not automatically convert it into a dimension.

18. Conclusion

Discrete and continuous fields are essential concepts in Tableau because they determine how data is presented in visualizations. Discrete fields typically create separate headers for categories, while continuous fields typically create axes that represent ranges of values.

By understanding blue and green pills, choosing suitable date configurations, and converting supported fields when necessary, you can create charts that communicate information clearly and accurately. Always remember that discrete and continuous are different from dimensions and measures, and choose the field configuration that best supports your analysis.

Continue learning with JustAcademy Tableau Training or Register for a Tableau Course Demo.


19. Official Tableau Learning Resources

whatsapp